this.BX=this.BX||{};(function(t,i,e,n){"use strict";var s,a,r,l,o,h,u,g,d;var v=function(){function t(e){var n=e.target,s=e.title,a=e.cross,r=e.items,l=e.buttons,o=e.link,h=e.hint,u=e.width,g=e.height,d=e.minWidth,v=e.minHeight;babelHelpers.classCallCheck(this,t);this.target=i.Type.isDomNode(n)?n:null;this.title=i.Type.isString(s)||i.Type.isObject(s)?s:null;this.cross=i.Type.isBoolean(a)?a:true;this.items=i.Type.isArray(r)?r:[];this.buttons=i.Type.isArray(l)?l:null;this.link=i.Type.isObject(o)?o:null;this.hint=i.Type.isString(h)?h:null;this.width=i.Type.isNumber(u)?u:null;this.height=i.Type.isNumber(g)?g:null;this.minWidth=i.Type.isNumber(d)?d:null;this.minHeight=i.Type.isNumber(v)?v:null;this.layout={wrapper:null,container:null,items:null,title:null,text:null,link:null,remove:null,buttons:null};this.popupHint=null}babelHelpers.createClass(t,[{key:"getWrapper",value:function t(){if(!this.layout.wrapper){this.layout.wrapper=i.Tag.render(s||(s=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-migration-bar__wrap"></div>\n\t\t\t'])))}return this.layout.wrapper}},{key:"getContainer",value:function t(){var e=this;if(!this.layout.container){this.layout.container=i.Tag.render(a||(a=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-migration-bar__container ui-migration-bar__scope --show">\n\t\t\t\t\t','\n\t\t\t\t\t<div class="ui-migration-bar__content">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\t\t\t\t\t</div>\n\t\t\t\t\t","\n\t\t\t\t</div>\n\t\t\t"])),this.cross?this.getCross():"",this.title?this.getTitle():"",this.getItemContainer(),this.getButtonsContainer());this.layout.container.addEventListener("animationend",(function(){e.layout.container.classList.remove("--show")}),{once:true});if(this.width){this.layout.container.style.setProperty("width",this.width+"px")}if(this.height){this.layout.container.style.setProperty("height",this.height+"px")}if(this.minWidth){this.layout.container.style.setProperty("min-width",this.minWidth+"px")}if(this.minHeight){this.layout.container.style.setProperty("min-height",this.minHeight+"px")}}return this.layout.container}},{key:"getTitle",value:function t(){if(!this.layout.title){var e,n;var s=i.Type.isObject(this.title);var a=s?(e=this.title)===null||e===void 0?void 0:e.text:this.title;var l=s?(n=this.title)===null||n===void 0?void 0:n.align:null;this.layout.title=i.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-migration-bar__title ','">\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t</div>\n\t\t\t"])),l?"--align-"+l:"",a,this.hint?this.getHint():"")}return this.layout.title}},{key:"getCross",value:function t(){var e=this;if(!this.layout.remove){this.layout.remove=i.Tag.render(l||(l=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-migration-bar__remove">\n\t\t\t\t\t<div class="ui-migration-bar__remove-icon"></div>\n\t\t\t\t</div>\n\t\t\t'])));this.layout.remove.addEventListener("click",(function(){return e.remove()}))}return this.layout.remove}},{key:"getButtonsContainer",value:function t(){if(!this.layout.buttons){this.layout.buttons=i.Tag.render(o||(o=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-migration-bar__btn-container"></div>\n\t\t\t'])))}return this.layout.buttons}},{key:"getItemContainer",value:function t(){if(!this.layout.items){this.layout.items=i.Tag.render(h||(h=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-migration-bar__item-container"></div>\n\t\t\t'])))}return this.layout.items}},{key:"getImage",value:function t(){return this.items}},{key:"getLink",value:function t(){var e=this;if(!this.layout.link){var n;var s=(n=this.link)!==null&&n!==void 0&&n.href?"a":"div";this.layout.link=i.Tag.render(u||(u=babelHelpers.taggedTemplateLiteral(["\n\t\t\t\t<",' class="ui-migration-bar__link">',"</",">\n\t\t\t"])),s,this.link.text,s);var a=function t(){e.layout.link.classList.add("--cursor-pointer")};if(this.link.href){a();this.layout.link.href=this.link.href}if(this.link.target){this.layout.link.target=this.link.target}if(this.link.events){a();var r=Object.keys(this.link.events);r.forEach((function(t){e.layout.link.addEventListener(t,(function(){e.link.events[t]()}))}))}}return this.layout.link}},{key:"getHint",value:function t(){var e=this;if(!this.layout.hint){this.layout.hint=i.Tag.render(g||(g=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-migration-bar__hint">\n\t\t\t\t\t<div class="ui-migration-bar__hint-icon"></div>\n\t\t\t\t</div>\n\t\t\t'])));var s=200;var a=20;this.popupHint=new n.Popup(null,this.layout.hint,{darkMode:true,content:this.hint,angle:{offset:s/2-16},width:s,offsetLeft:-(s/2)+a/2+40,animation:"fading-slide"});this.layout.hint.addEventListener("mouseover",(function(){e.popupHint.show()}));this.layout.hint.addEventListener("mouseleave",(function(){e.popupHint.close()}))}return this.layout.hint}},{key:"adjustItemData",value:function t(){this.items=this.items.map((function(t){return{id:t.id?t.id:null,src:t.src?t.src:null,events:t.events?t.events:null}}))}},{key:"setButtons",value:function t(){var i=this;if(this.buttons.length>0){this.buttons.forEach((function(t){var n=Object.assign({},t);t=new e.Button(n);i.getButtonsContainer().appendChild(t.render())}))}}},{key:"render",value:function t(){var e=this,n;if(this.target){this.getWrapper().style.setProperty("height",this.target.offsetHeight+"px");this.target.appendChild(this.getWrapper());this.getWrapper().appendChild(this.getContainer())}if(this.items.length>0){this.items.forEach((function(t){var n=t;n=i.Tag.render(d||(d=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<img class="ui-migration-bar__item">\n\t\t\t\t'])));e.getItemContainer().appendChild(n);var s=Object.keys(t);for(var a=0;a<s.length;a++){var r=s[a];n.setAttribute(r,t[r])}}))}if((n=this.link)!==null&&n!==void 0&&n.text){this.getItemContainer().appendChild(this.getLink())}}},{key:"remove",value:function t(){var i=this;this.getContainer().classList.add("--close");this.getContainer().addEventListener("animationend",(function(){i.getContainer().classList.remove("--close");i.getContainer().remove();i.getWrapper().remove()}),{once:true})}},{key:"show",value:function t(){this.adjustItemData();this.setButtons();this.render()}}]);return t}();t.MigrationBar=v})(this.BX.UI=this.BX.UI||{},BX,BX.UI,BX.Main);
//# sourceMappingURL=migrationbar.bundle.map.js